package crypto.process;

/**
 * DOCUMENT ME!
 *
 * @author gato
 */
public class Perspective {
  /**
   * DOCUMENT ME!
   *
   * @param text DOCUMENT ME!
   *
   * @return DOCUMENT ME!
   */
  public static String viewPerspective(String text) {
    /*
       int parte1 = cry1.length();
       int parte2 = cry2.length();
       int parte3 = cry3.length();
       String texto = cry1+cry2+cry3;
       int largo = texto.length();
       largo = (largo /3)+1;
       char arrA[];
       char arrB[];
       char arrC[];
       int arr1[] = new int[largo];
       int arr2[] = new int[largo];
       int arr3[] = new int[largo];
       String arrP1[] = new String[largo];
       String arrP2[] = new String[largo];
       String arrP3[] = new String[largo];
       //Realizo la division pareja en 3 partes del texto.
       cry1 = texto.substring(0, largo);
       cry2 = texto.substring(largo,(largo+largo));
       cry3 = texto.substring((largo+largo));
       arrA = cry1.toCharArray();
       arrB = cry2.toCharArray();
       arrC = new char[largo];
       char arr[]= cry3.toCharArray();
       int largo2 = arr.length;
       for(int i=0;i<largo2;i++){
           arrC[i]=arr[i];
       }
       for(int j=largo2;j<largo;j++){
           arrC[j]= (char) ((Math.random()*27)+65);
       }
       //Convertir caracteres en el equivalente numerico.
       for(int a=0;a<largo;a++){
           arr1[a]= (int) arrA[a];
       }
       for(int b=0;b<largo;b++){
           arr2[b]= (int) arrB[b];
       }
       for(int c=0;c<largo;c++){
           arr3[c]= (int) arrC[c];
       }
       //Convertir numeros en cadena de texto.
       for(int q=0;q<largo;q++){
           String x= new String(""+arr1[q]);
           arrP1[q] = x;
       }
       for(int w=0;w<largo;w++){
           String x= new String(""+arr2[w]);
           arrP2[w] = x;
       }
       for(int e=0;e<largo;e++){
           String x= new String(""+arr3[e]);
           arrP3[e] = x;
       }
       //Comenzar proceso de mezcla en perspectiva.
       for(int f=0;f<largo;f++){
           String z,x,c,v,m,n;
           if(arrP1[f].length()==3){
               z= arrP1[f].substring(0,2);
               v= arrP1[f].substring(2);
           }else{
               z= arrP1[f].substring(0,1);
               v= arrP1[f].substring(1);
           }
           if(arrP2[f].length()==3){
               x= arrP2[f].substring(0,2);
               m= arrP2[f].substring(2);
           }else{
               x= arrP2[f].substring(0,1);
               m= arrP2[f].substring(1);
           }
           if(arrP3[f].length()==3){
               c= arrP3[f].substring(0,2);
               n= arrP3[f].substring(2);
           }else{
               c= arrP3[f].substring(0,1);
               n= arrP3[f].substring(1);
           }
           arrP1[f]=c+v;
           arrP2[f]=z+m;
           arrP3[f]=x+n;
       }
       for(int aa=0;aa<largo;aa++){
           arrA[aa] = (char) (Integer.parseInt(arrP1[aa]));
       }
       for(int bb=0;bb<largo;bb++){
           arrB[bb] = (char) (Integer.parseInt(arrP2[bb]));
       }
       for(int cc=0;cc<largo;cc++){
           arrC[cc] = (char) (Integer.parseInt(arrP3[cc]));
       }
       cry1= new String(arrA);
       cry2= new String(arrB);
       cry3= new String(arrC);
       int num = (int) (Math.random()*82000);
       parte1+=num;
       parte2+=num;
       parte3+=num;
       String numero = DeciS32(num);
       cry1 = DeciS32(parte1)+cry1;
       cry2 = DeciS32(parte2)+cry2;
       cry3 = DeciS32(parte3)+cry3;
       int sec = (int) (Math.random()*6);
       switch(sec){
           case(0):
               char ok = (char) ((Math.random()*4)+65);
               texto= ""+ok+numero+cry1+cry2+cry3;break;
           case(1):
               char ok1 = (char) ((Math.random()*4)+69);
               texto= ""+ok1+numero+cry1+cry3+cry2;break;
           case(2):
               char ok2 = (char) ((Math.random()*4)+73);
               texto= ""+ok2+numero+cry2+cry1+cry3;break;
           case(3):
               char ok3 = (char) ((Math.random()*4)+77);
               texto= ""+ok3+numero+cry2+cry3+cry1;break;
           case(4):
               char ok4 = (char) ((Math.random()*4)+81);
               texto= ""+ok4+numero+cry3+cry1+cry2;break;
           case(5):
               char ok5 = (char) ((Math.random()*4)+85);
               texto= ""+ok5+numero+cry3+cry2+cry1;break;
       }
     */
    return text;
  }
}
